package com.ruoyi.annotation;

import java.lang.annotation.*;

/**
 * 实体类属性字段注解
 *
 * @author: Gao Tianle
 * @date: 2023-11-27 11:39
 **/
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface BeanFieldType {

    /**
     * 字段的中文名称
     * @return
     */
    public String name() default "";

    /**
     * 字段的类型
     * @return
     */
    public Type type() default Type.STRING;


    public enum Type
    {
        //String
        STRING(0),
        //Integer,int
        INTEGER(1),
        //Double,double
        DOUBLE(2),
        //Float,float
        FLOAT(3),
        //Long long
        LONG(4),
        //Date
        DATE(5);
        private int value;
        Type(int value){
            this.value = value;
        }

        public int value(){
            return this.value;
        }
    }
}
